package com.yc.controller;


import com.yc.entity.Comment2;
import com.yc.mapper.Comment2Mapper;
import com.yc.service.IComment2Service;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * InnoDB free: 4096 kB 前端控制器
 * </p>
 *
 * @author ly
 * @since 2022-06-12
 */
@Controller
@RequestMapping("//comment2")
public class Comment2Controller {

    @Resource
    private  Comment2Mapper comment2Mapper;

    @Resource
    private IComment2Service iComment2Service;

     @RequestMapping("queryComment2")
    @ResponseBody
    public List<Comment2>  queryComment2(){
          return  comment2Mapper.queryComment2();
     }

    @RequestMapping("queryComment3")
    @ResponseBody
    public List<Comment2>  queryComment2(Integer cmid){
        return  iComment2Service.queryComment2(cmid);
    }



    @RequestMapping("addmessage")
    @ResponseBody
    public  Integer addmessage(Integer uid,String message){
          return   comment2Mapper.insert(uid,message);
    }
}



